<?php
namespace Admin\Controller;
use Think\Controller;
class CommonController extends Controller {
   public function __construct(){
       parent::__construct();
       //登录检查
       $this->checkUser();
   }
   private function checkUser() {
      
           if (!session('?loginname')){
     
           $this->error('请登录',U('Admin/Login/login'));
       }
   }
}